import request from '@/utils/request'

// 用户登入
export function userLogin(username, password) {
  return request({
    url: '/user/login',
    method: 'post',
    params: {
      username: username,
      password: password
    }
  })
}

// 用户退出登入
export function userLoginOut() {
  return request({
    url: '/user/loginout',
    method: 'delete'
  })
}

// 用户信息
export function userInfo(token) {
  return new Promise((resolve, reject) => {
    const data = {
      roles: ['admin'],
      introduction: 'I am a super administrator',
      avatar: 'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif',
      name: 'Super Admin'
    }
    resolve(data)
  })
}
